DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h

DO NOT USE THIS FILE - THIS IS THE OLD HEADER - USE Serial.h







/************************************************************************
*	Serial User Interface - RS232 Serial Data Transmission/Reception
*	
*	@brief	This is the code for implementation of the Serial Transmission/Reception
*	on the PICDEM18F452	microcontroller. It allows you to input data and read it at a time of 
*	your convenience using the ReadBuffer() function. It can handle ascii characters. Other inputs
*	are not defined and may give undefined results. The module is also capable of transmitting 
*	user data to the serial output.
*
*	This module is designed specifically for use as the serial interface between the PICDEM18f452
*	MicroController and HyperTerminal for the Team Cress Major Project in USER REMOTE MODE.
*
*	@author		Janek Savage
*	@file       serial_interface_m.c
*	@version	1	(stable)

*************************************************************************/
#ifndef SERIAL
#define SERIAL

/****************************************************
*   Serial_Setup() - setup the serial interface module
*	Use this function to setup the Serial interface module in 
*	your main function
*	Inputs:		None
*	Outputs:	None
*****************************************************/
void Serial_Setup (void);

/****************************************************
*   Serial_Setup_Interrupt() - setup the serial interface interrupts
*	Use this function to setup the Serial interface interrupts 
*	in your main function
*	Inputs:		None
*	Outputs:	None
*****************************************************/
void Serial_Setup_Interrupt (void);

/****************************************************
*   Serial_rxIsr() - Interrupt to obtain received data byte
*	Use this function in the low priority interrupt 
*	in your main function
*	Inputs:		None
*	Outputs:	None
*****************************************************/
void Serial_rxIsr(void);

/****************************************************
*   Serial_txIsr() - Interrupt to obtain transmit data byte
*	Use this function in the low priority interrupt 
*	in your main function
*	Inputs:		None
*	Outputs:	None
*****************************************************/
void Serial_txIsr(void);

/****************************************************
*   Serial_ReadBuffer() - Function to obtain next data byte 
*	in the receive buffer. Call this to get an input and 
*	test for what it is
*	Inputs:		None
*	Outputs:	Data byte
*****************************************************/
unsigned char Serial_ReadBuffer(void);

/****************************************************
*   Serial_AppendString() - Function to append a string to the
*	transmit buffer and send this.
*	Inputs:		string
*	Outputs:	None
*****************************************************/
void Serial_AppendString (unsigned char* string);

/****************************************************
*   Checkpin() - Function to check if the input PIN is correct
*	Inputs:		string
*	Outputs:	1 if correct, 0 if incorrect
*****************************************************/
unsigned char checkpin (unsigned char pincode[]);

/*************************************************************
*	int_2_string() - Function to transform unsigned int to string:
	
*	Inputs unsigned int , string:	
*	Outputs:	None
/***************************************************************/
void int_2_string(unsigned int n, char s[]);




#endif
